<?php

namespace app\modules\Basic\models;

use Yii;

/**
 * This is the model class for table "city_code".
 *
 * @property int $id
 * @property string $code 城市三字码
 * @property string $zh_name 城市中文名
 * @property string $en_name 城市英文名
 */
class CityCode extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'city_code';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['code'], 'required'],
            [['code'], 'string', 'max' => 10],
            [['zh_name'], 'string', 'max' => 32],
            [['en_name'], 'string', 'max' => 64],
            [['code'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'code' => Yii::t('app.basic', 'Code'),
            'zh_name' => Yii::t('app.basic', 'Zh Name'),
            'en_name' => Yii::t('app.basic', 'En Name'),
        ];
    }
}
